<template>
<div class="container" id="container">

    <div class="container-fluid">
        <table class="table table-hover">

          <tbody>
           <tr>
                <th>序号</th>
                <th>股票代码</th>
                <th>股票简称</th>
                <th>涨跌幅</th>
                <th>换手率</th>
                <th>最新价(元)</th>
                <th>前期高点</th>
                <th>前期高点日期</th>
                <th>添加自选</th>
            </tr>
            <tr v-for="i in data_list">
                <td>{{i.id}}</td>
                <td>{{i.code}}</td>
                <td>{{i.sname}}</td>
                <td>{{i.rate01}}</td>
                <td>{{i.rate02}}</td>
                <td>{{i.new_prize}}</td>
                <td>{{i.high}}</td>
                <td>{{i.date}}</td>
                <td><input type="button" value="添加" name="toAdd"></td>
            </tr>
        </tbody>

        </table>
    </div>
</div>

</template>

<script>
export default {
  name: 'indexList',
  data () {
    return {
    //   组件的数据 -- 存储的数据是什么样子的？[{},{}]
        list1:[]
    }
  },
  mounted:function(){
      this.axios({
          url:'/index_data',
          method:'get'
      }).then(
        //   function(dat){

        //   console.log(dat.data)
        //   this.list1 = dat.data
        //  }
        dat => {
            this.list1 = dat.data
        }
      )
      .catch(function(){})
  }
}
</script>

